package com.max.mil.fuwu.service.impl;

import com.max.mil.fuwu.service.SaleService;
import com.yhd.YhdClient;
import com.yhd.request.promotion.PromotionPriceAddRequest;
import com.yhd.response.promotion.PromotionPriceAddResponse;

public class SaleServiceImpl implements SaleService
{

	public static void main(String[] args) throws Exception
	{
		YhdClient yhdClient = new YhdClient(
				"http://openapi.1mall.com/app/api/rest/router", 
				"10420013082700000187", 
				"e772e2b27c5446eecc1abf9850de0004", 
				"4c0810a3834810c04d4db680f3ec657d", "json");
		
		PromotionPriceAddRequest request = new PromotionPriceAddRequest();
		request.setStartDate("2014-01-01 00:00:00");
		request.setEndDate("2014-01-01 23:59:59");
		request.setProductStr("12741156,0.7,3,300;12741158,0.8,2,200");
//		request.setProductStrSerial(null);
//		request.setIsAttachShippingProm(0);
//		request.setPostage(0);
		request.setIsPrice(0);
		PromotionPriceAddResponse response = yhdClient.excute(request, null);
		System.out.println("1");
	}

	@Override
	public int addSale(int promId, PromotionPriceAddRequest req)
	{
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int delSale(int promId, String id)
	{
		// TODO Auto-generated method stub
		return 0;
	}
}
